<template>
    <el-drawer
    :title="!dataForm.id ? '新增' : '修改'"
    direction="rtl"
    ref="drawer"
    size="60%"
    class="drawerpp"
    @close="closeDataform"
    v-loading="dataListLoading"
    :destroy-on-close="true"
    :visible.sync="visible">
    <!-- <div class="demo-drawer__header"> -->
      <!-- <el-row> -->
        <!-- <el-col :span="12" style="text-align:center;">
          <el-upload
            class="avatar-uploader"
            :action="uploadUrl()"
            :with-credentials="true"
            :headers="myHeader"
            :show-file-list="false"
            :on-error="onError"
            :on-success="handleAvatarSuccess">
            <img v-if="avatarPic" :src="remoteUrl + avatarPic" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-col> -->
        <!-- <el-col :span="12">
          <el-button size="mini" @click="visible = false">取 消</el-button>
          <el-button type="primary" plain size="mini" @click="dataFormSubmit()">确 定</el-button>
        </el-col> -->
      <!-- </el-row> -->
    <!-- </div> -->
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="120px">
      <el-row>
        <el-col :span="12">
          <el-form-item key="deptId" label="所在部门" class="item-sse" prop="deptId">
            <el-tree-select
              style="width:100%"
              :data="treeData"
              v-model="dataForm.deptId"
              node-key="id"
              placeholder="请选择部门"
              @focus="initOrgTree"
              />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item key="name" label="姓名" prop="name">
            <el-input v-model="dataForm.name" placeholder="姓名"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item  label="身份证号" prop="idCard">
            <el-input key="idCard" v-model="dataForm.idCard" placeholder="身份证号"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="婚姻状况">
               <el-select v-model="dataForm.marriageFlag" placeholder="请选择" style="width:100%">
                <el-option
                  v-for="item in marriageFlags"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
             </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="手机号码">
            <el-input v-model="dataForm.mobile" placeholder="手机号码" maxlength="11"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="职位">
            <el-input v-model="dataForm.post" placeholder="职位"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="入职时间">
            <el-date-picker type="date" v-model="dataForm.entryTime" :picker-options="pickerOptionsValidityEndTimeA" placeholder="入职时间" style="width:100%"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="合同到期日期">
            <el-date-picker type="date" v-model="dataForm.contractExpirationTime" @blur="blurTime" :picker-options="pickerOptionsValidityEndTime" placeholder="合同到期日期" style="width:100%"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="员工状态">
               <el-select v-model="dataForm.onCompanyFlag" placeholder="请选择" style="width:100%">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
             </el-form-item>
        </el-col>
        <el-col v-if="dataForm.onCompanyFlag == 0" :span="12">
          <el-form-item label="员工离职日期">
            <el-date-picker type="date" v-model="dataForm.companyEndTime" placeholder="请选择离职日期" style="width:100%"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="学历">
            <el-select v-model="dataForm.academic" placeholder="请选择学历" style="width:100%">
                <el-option
                  v-for="item in academics"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="专业">
            <el-input v-model="dataForm.schoolProfession" placeholder="请输入专业"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="毕业时间">
            <el-date-picker type="date" v-model="dataForm.graduateTime" placeholder="请选择毕业时间" style="width:100%"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否缴社保">
            <el-select v-model="dataForm.socialSecurityFlag" placeholder="请选择" style="width:100%">
                <el-option
                  v-for="item in social"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </el-form-item>
        </el-col>
        <el-col v-if="this.dataForm.socialSecurityFlag == 1" :span="12">
          <el-form-item label="参保日期">
            <el-date-picker type="date" v-model="dataForm.socialSecurityTime" placeholder="请选择参保日期" style="width:100%"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="技术负责人">
            <el-select v-model="dataForm.directorFlag" placeholder="请选择" style="width:100%">
                <el-option
                  v-for="item in social"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </el-form-item>
        </el-col>
        <el-col v-if="this.dataForm.directorFlag == 1" :span="12">
          <el-form-item label="负责内容">
            <el-input v-model="dataForm.directorFor" placeholder="请填写负责内容"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item key="remark" label="员工成长日志" prop="remark">
            <el-input type="textarea" :rows="2" v-model="dataForm.remark" placeholder="请填写情况说明"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="上传简历">
            <el-upload
              :action="uploadUrl()"
              :headers="myHeader"
              :on-success="onContractSuccess"
              :on-error="onError"
              :show-file-list="showList"
              :file-list="img"
              ref="certiUpload"
              list-type="picture-card">
                <i class="el-icon-plus"></i>
                <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过800kb</div>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24" style="text-align:center;">
        <el-button size="small " @click="clickCancel">取 消</el-button>
        <el-button type="primary" plain size="small " @click="dataFormSubmit()">确 定</el-button>
        </el-col>
      </el-row>
    </el-form>
  </el-drawer>
</template>

<script>
  import Vue from 'vue'
  import ElTreeSelect from '@/components/treeSelect/index.vue'

  export default {
    data () {
      return {
        visible: false,
        imageDialogVisible: false,
        disabled: false,
        dataListLoading: false,
        treeData: [],
        limitNum: 1,
        showList: true,
        isAdd: true,
        dataForm: {
          id: 0,
          deptId: '',
          tenantId: '',
          name: '',
          idCard: '',
          gender: '',
          mobile: '',
          academic: '',
          jobGrade: '',
          entryTime: '',
          contractExpirationTime: '',
          remark: '',
          post: '',
          schoolProfession: '',
          marriageFlag: '',
          graduateTime: '',
          socialSecurityFlag: 0,
          socialSecurityTime: '',
          directorFlag: 1,
          directorFor: '',
          companyEndTime: '',
          onCompanyFlag: 1
        },
        imgDialogImageUrl: '',
        pickerOptionsValidityEndTime: {
          disabledDate: (time) => {
            return time.getTime() < this.dataForm.entryTime
          }
        },
        pickerOptionsValidityEndTimeA: {},
        marriageFlags: [{
          value: 0,
          label: '未婚'}, {
            value: 1,
            label: '已婚'
          }
        ],
        options: [{
          value: 1,
          label: '在职'}, {
            value: 0,
            label: '离职'
          }
        ],
        social: [{
          value: 0,
          label: '否'}, {
            value: 1,
            label: '是'
          }
        ],
        academics: [{
          value: '博士',
          label: '博士'
        }, {
          value: '硕士',
          label: '硕士'
        }, {
          value: '本科',
          label: '本科'
        }, {
          value: '专科',
          label: '专科'
        }, {
          value: '高职高专',
          label: '高职高专'
        }, {
          value: '中专',
          label: '中专'
        }, {
          value: '高中',
          label: '高中'
        }, {
          value: '初中',
          label: '初中'
        }, {
          value: '小学',
          label: '小学'
        }, {
          value: '其他',
          label: '其他'
        }],
        genders: [{
          value: 1,
          label: '男'
        }, {
          value: 2,
          label: '女'
        }],
        dataRule: {
          deptId: [
            { required: true, message: '请选择部门', trigger: 'blur' }
          ],
          name: [
            { required: true, message: '请填写姓名', trigger: 'blur' }
          ],
          // idCard: [
          //   { required: true, message: '请填写身份证号', trigger: 'blur' },
          //   { validator: this.validID, trigger: 'blur' }
          // ],
          idCard: [{required: true, validator: this.chinaIdentityValid, trigger: 'blur'}],
          mobile: [
            { required: true, len: 11, message: '请填写正确的手机号码', trigger: 'blur' }
          ],
          academic: [
            { required: true, message: '请选择学历', trigger: 'blur' }
          ],
          jobGrade: [
            { required: true, message: '请选择职称', trigger: 'blur' }
          ],
          entryTime: [
            { required: true, message: '请选择入职时间', trigger: 'blur' }
          ],
          contractExpirationTime: [
            { required: true, message: '请选择合同到期日期', trigger: 'blur' }
          ]
        },
        tenantId: '',
        remoteUrl: '',
        baseInfoPics: [],
        avatarPic: ''
      }
    },
    props: {
      img: {
        type: Array
      },
      manualupdate: {
        type: Number
      },
      cacheData: {
        type: Object,
        default: () => {
          return {
            id: 0,
            deptId: '',
            tenantId: '',
            name: '',
            idCard: '',
            gender: '',
            mobile: '',
            academic: '',
            jobGrade: '',
            entryTime: '',
            contractExpirationTime: '',
            remark: '',
            post: '',
            schoolProfession: '',
            marriageFlag: '',
            graduateTime: '',
            socialSecurityFlag: 0,
            socialSecurityTime: '',
            directorFlag: 1,
            directorFor: '',
            companyEndTime: '',
            onCompanyFlag: 1
          }
        }
      }
    },
    components: {
      ElTreeSelect
    },
    created () {

      // console.log(this.img);
    },
    watch: {
      visible (nV) {
        if (nV && this.isAdd) {
          Object.keys(this.dataForm).forEach((key) => { this.dataForm[`${key}`] = this.cacheData[`${key}`] })
        }
      },
      isAdd (nV, oV) {
        if (nV && !oV) {
          let initForm = this.getInitDataForm()
          Object.keys(this.dataForm).forEach((key) => { this.dataForm[`${key}`] = initForm[`${key}`] })
        }
      }
      /*,
      cacheData: {
        handler: function () {
          console.log('change')
          this.$nextTick(() => {
            Object.keys(this.dataForm).forEach((key) => { this.dataForm[`${key}`] = this.cacheData[`${key}`] })
          })
        },
        deep: true
      } */
    },
    computed: {
      myHeader () {
        return {'token': Vue.cookie.get('token')}
      }
    },
    methods: {

      clickCancel () {
        if (this.isAdd) {
          let initForm = this.getInitDataForm()
          Object.keys(this.dataForm).forEach((key) => { this.dataForm[`${key}`] = initForm[`${key}`] })
          this.$emit('setCacheData', this.dataForm)
        }
        this.visible = false
      },
      getInitDataForm () {
        return {id: 0,
          deptId: '',
          tenantId: '',
          name: '',
          idCard: '',
          gender: '',
          mobile: '',
          academic: '',
          jobGrade: '',
          entryTime: '',
          contractExpirationTime: '',
          remark: '',
          post: '',
          schoolProfession: '',
          marriageFlag: '',
          graduateTime: '',
          socialSecurityFlag: 0,
          socialSecurityTime: '',
          directorFlag: 1,
          directorFor: '',
          companyEndTime: '',
          onCompanyFlag: 1}
      },
      closeDataform () {
        // console.log(111)
        if (this.isAdd) {
          this.$emit('setCacheData', this.dataForm)
        } else {
          this.$emit('setCacheData', this.getInitDataForm())
        }
    /*    this.dataForm = {
          id: 0,
          deptId: '',
          tenantId: '',
          name: '',
          idCard: '',
          gender: '',
          mobile: '',
          academic: '',
          jobGrade: '',
          // entryTime: '',
          // contractExpirationTime: '',
          remark: '',
          post: '',
          schoolProfession: '',
          marriageFlag: '',
          graduateTime: '',
          socialSecurityFlag: 0,
          socialSecurityTime: '',
          directorFlag: 1,
          directorFor: '',
          companyEndTime: '',
          onCompanyFlag: 1
        } */
      },
      blurTime () {
        if (this.dataForm.contractExpirationTime !== '') {
          this.pickerOptionsValidityEndTimeA = {
            disabledDate: (time) => {
              return time.getTime() > this.dataForm.contractExpirationTime
            }
          }
        } else {
          this.pickerOptionsValidityEndTimeA = {}
        }
      },
      chinaIdentityValid: (rule, value, callback) => {
        if (!value) {
          return callback()
        }
        let city = {
          11: '北京',
          12: '天津',
          13: '河北',
          14: '山西',
          15: '内蒙古',
          21: '辽宁',
          22: '吉林',
          23: '黑龙江 ',
          31: '上海',
          32: '江苏',
          33: '浙江',
          34: '安徽',
          35: '福建',
          36: '江西',
          37: '山东',
          41: '河南',
          42: '湖北 ',
          43: '湖南',
          44: '广东',
          45: '广西',
          46: '海南',
          50: '重庆',
          51: '四川',
          52: '贵州',
          53: '云南',
          54: '西藏 ',
          61: '陕西',
          62: '甘肃',
          63: '青海',
          64: '宁夏',
          65: '新疆',
          71: '台湾',
          81: '香港',
          82: '澳门',
          91: '国外'
        }
        if (!value || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(value)) {
          callback(new Error('身份证号格式错误'))
        } else if (!city[value.substr(0, 2)]) {
          callback(new Error('身份证号格式错误'))
        } else {
      // 18位身份证需要验证最后一位校验位
          if (value.length === 18) {
            const code = value.split('')
        // ∑(ai×Wi)(mod 11)
        // 加权因子
            const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
        // 校验位
            const parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
            let sum = 0
            let ai = 0
            let wi = 0
            for (let i = 0; i < 17; i++) {
              ai = code[i]
              wi = factor[i]
              sum += ai * wi
            }
            if (parity[sum % 11].toString() !== code[17]) {
              callback(new Error('输入的身份证号有误'))
            }
          }
        }
        callback()
      },
      init (id, tenantId) {
        this.tenantId = tenantId || 0
        this.dataForm.id = id || 0
        this.isAdd = !id
        this.avatarPic = ''
        this.visible = true
        this.initOrgTree()
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            this.$http({
              url: this.$http.adornUrl(`/certificate/employeeInfo/info/${this.dataForm.id}`),
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.remoteUrl = data.remoteUrl
                this.avatarPic = data.e.avatarPic
                this.dataForm.id = data.e.id
                this.dataForm.onCompanyFlag = data.e.onCompanyFlag
                this.dataForm.tenantId = data.e.tenantId
                this.dataForm.deptId = data.e.deptId
                this.dataForm.name = data.e.name
                this.dataForm.idCard = data.e.idCard
                this.dataForm.gender = data.e.gender
                this.dataForm.mobile = data.e.mobile
                this.dataForm.schoolProfession = data.e.schoolProfession
                this.dataForm.companyEndTime = data.e.companyEndTime
                this.dataForm.academic = data.e.academic
                this.dataForm.jobGrade = data.e.jobGrade
                this.dataForm.marriageFlag = data.e.marriageFlag
                let entryTime = data.e.entryTime
                if (entryTime) {
                  this.dataForm.entryTime = new Date(data.e.entryTime)
                }

                let contractExpirationTime = data.e.contractExpirationTime
                if (contractExpirationTime) {
                  this.dataForm.contractExpirationTime = new Date(data.e.contractExpirationTime)
                }

                this.dataForm.remark = data.e.remark
                this.dataForm.graduateTime = data.e.graduateTime
                this.dataForm.directorFor = data.e.directorFor
                this.dataForm.directorFlag = data.e.directorFlag
                this.dataForm.socialSecurityTime = data.e.socialSecurityTime
                this.dataForm.socialSecurityFlag = data.e.socialSecurityFlag
                this.dataForm.post = data.e.post
                this.baseInfoPics = []
                if (data.e.contractInfoList && data.e.contractInfoList.length > 0) {
                  for (var i = 0; i < data.e.contractInfoList.length; i++) {
                    this.baseInfoPics.push(data.e.contractInfoList[i].path)
                  }
                }
              }
            })
          }
        })
      },
      errorHandler () {
        return true
      },
      imgHandleRemove (file) {
        this.$refs.certiUpload.clearFiles()
      },
      imgHandlePictureCardPreview (file) {
        this.imgDialogImageUrl = file.url
        this.imageDialogVisible = true
      },
      clickFilets (file) {
        this.imgHandlePictureCardPreview(file)
      },
      handleAvatarSuccess (response, file, fileList) {
        this.remoteUrl = response.remoteUrl
        this.avatarPic = response.fileName
      },
      onContractSuccess (response, file, fileList) {
        this.remoteUrl = response.remoteUrl
        this.baseInfoPics = []
        for (var i = 0; i < fileList.length; i++) {
          this.baseInfoPics.push(fileList[i].response.fileName)
        }
      },
      // eslint-disable-next-line handle-callback-err
      onError (err, file, fileList) {
        this.$message.error('上传失败')
      },
      uploadUrl () {
        return this.$http.adornUrl('/certificate/employeeInfo/upload')
      },
       // 身份证验证
      async validID (rule, value, callback) {
        // 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
        let reg = /(^\d{18}$)|(^\d{17}(\d|X|x)$)/
        if (reg.test(value)) {
          await this.go(value)
          callback()
        } else {
          callback(new Error('身份证号码不正确'))
        }
      },
      // 实现自动生成生日，性别，年龄
      // go(iden) {
      //   let sex = null;
      //   let birth = null;
      //   let myDate = new Date();
      //   let month = myDate.getMonth() + 1;
      //   let day = myDate.getDate();
      //   let age = 0;

      //   age = myDate.getFullYear() - iden.substring(6, 10) - 1;
      //   sex = iden.substring(16,17);
      //   birth = iden.substring(6,10)+"-"+iden.substring(10,12)+"-"+iden.substring(12,14);
      //   if (iden.substring(10, 12) < month || iden.substring(10, 12) == month && iden.substring(12, 14) <= day) age++;

      //   if(sex%2 === 0)
      //     sex = 2;
      //   else
      //     sex = 1;
      //   this.dataForm.gender = sex;
      //   //this.baseInfo.age = age;
      //   //this.baseInfo.birthday = birth;
      //   //this.baseInfo.birthplace = this.area[iden.substring(0,2)];
      // },
      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            this.dataListLoading = true
            this.$http({
              url: this.$http.adornUrl(`/certificate/employeeInfo/${!this.dataForm.id ? 'save' : 'update'}`),
              method: 'post',
              data: this.$http.adornData({
                'id': this.dataForm.id || undefined,
                'tenantId': this.dataForm.tenantId,
                'deptId': this.dataForm.deptId,
                'name': this.dataForm.name,
                'post': this.dataForm.post,
                'idCard': this.dataForm.idCard,
                'gender': this.dataForm.gender,
                'mobile': this.dataForm.mobile,
                'academic': this.dataForm.academic,
                'jobGrade': this.dataForm.jobGrade,
                'schoolProfession': this.dataForm.schoolProfession,
                'marriageFlag': this.dataForm.marriageFlag,
                'entryTime': this.$dateFormat(this.dataForm.entryTime),
                'contractExpirationTime': this.$dateFormat(this.dataForm.contractExpirationTime),
                'remark': this.dataForm.remark,
                'onCompanyFlag': this.dataForm.onCompanyFlag,
                'companyEndTime': this.dataForm.companyEndTime,
                'graduateTime': this.dataForm.graduateTime,
                'socialSecurityFlag': this.dataForm.socialSecurityFlag,
                'socialSecurityTime': this.dataForm.socialSecurityTime,
                'directorFlag': this.dataForm.directorFlag,
                'directorFor': this.dataForm.directorFor,
                'constractPic': this.baseInfoPics.join(','),
                'avatarPic': this.avatarPic
              })
            }).then(({data}) => {
              if (data && data.code === 0) {
                if (this.manualupdate === 1) {
                  this.$parent.initOrgTree()
                  this.$parent.keepDeptChange()
                }
                if (this.manualupdate === 2) {
                  this.$parent.keepDeptDataEdit()
                }
                this.$message({
                  message: '操作成功',
                  type: 'success',
                  duration: 1500,
                  onClose: () => {
                    this.dataForm = {
                      id: 0,
                      deptId: '',
                      tenantId: '',
                      name: '',
                      idCard: '',
                      gender: '',
                      mobile: '',
                      academic: '',
                      jobGrade: '',
                      entryTime: '',
                      contractExpirationTime: '',
                      remark: '',
                      post: '',
                      schoolProfession: '',
                      marriageFlag: '',
                      graduateTime: '',
                      socialSecurityFlag: 0,
                      socialSecurityTime: '',
                      directorFlag: 1,
                      directorFor: '',
                      companyEndTime: '',
                      onCompanyFlag: 1
                    }
                    this.img = []
                    this.visible = false
                    this.dataListLoading = false
                    this.$emit('clickGetList')
                    this.$emit('refreshDataList')
                  }
                })
              } else {
                this.$message.error(data.msg)
                this.dataListLoading = false
              }
            })
          }
        })
        // this.$parent.keepDeptChange()
        // this.$parent.getDataList()
        // this.$parent.showNotice()
        this.$parent.getPersonnelDetails()
      },
      initOrgTree () {
        this.$http({
          url: this.$http.adornUrl('/tenant/tenantDeptInfo/tree'),
          method: 'get',
          params: this.$http.adornParams({'tenandId': this.tenantId, 'filterFlag': 1})
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.treeData = [data.deptInfo]
          } else {
            this.treeData = []
          }
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
/deep/.upload-ss{
.div-ssup{
  .el-upload-list__item-actions{
    .delete-sse{
      z-index:10
    }
  }
}
}
/*1.显示滚动条：当内容超出容器的时候，可以拖动：*/
/deep/.drawerpp{
.el-drawer__open{
  .el-drawer{
    .el-drawer__body{
      overflow: auto;
    }
  }
}

// .el-drawer__body {
//    overflow: auto;
// }
}
/*2.隐藏滚动条，太丑了*/
// /deep/.el-drawer__container ::-webkit-scrollbar{
//     display: none;
// }

/*2.隐藏滚动条，太丑了*/
// .el-drawer__container ::-webkit-scrollbar{
//     display: none;
// }
/deep/.item-sse{
  margin-bottom: 18px !important;
}
/deep/.item-image{
 .dialogIndex{
  z-index: 3000 !important;
 }
}
/deep/.v-modal{
  z-index: 0 !important;
}
.img-se{
  z-index:4000 !important;
}

    // .demo-drawer {
    //     &__content {
    //         display: flex;
    //         flex-direction: column;
    //         height: 100%;
    //         form {
    //             flex: 1;
    //         }
    //     }
    //     &__footer {
    //         display: flex;
    //         button {
    //             flex: 1;
    //         }
    //     }
    //     &__header {
    //         text-align:right;
    //         margin-bottom:20px;
    //         width:100%;
    //     }
    // }
    // .el-drawer__body {
    //     padding: 20px;
    // }
    // .el-drawer__body{
    //   // overflow-x:hidden;
    //   overflow-y:auto;
    // }
    // .avatar-uploader .el-upload {
    //   border: 1px dashed #d9d9d9;
    //   border-radius: 50px;
    //   cursor: pointer;
    //   position: relative;
    //   overflow: hidden;
    // }
    .avatar-uploader .el-upload:hover {
      border-color: #409EFF;
    }
    .avatar-uploader-icon {
      font-size: 28px;
      color: #8c939d;
      width: 70px;
      height: 70px;
      line-height: 70px;
      text-align: center;
    }
    .el-icon-plus{
      text-align: center;
    }
    .avatar {
      width: 70px;
      height: 70px;
      display: block;
    }
    .el-input__inner{
      height: 36px;
    }
</style>
